package org.example.thymeleaf.demo.demos.controller;


import cn.zhxu.bs.BeanSearcher;
import cn.zhxu.bs.MapSearcher;
import cn.zhxu.bs.SearchResult;
import cn.zhxu.bs.util.MapUtils;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.example.thymeleaf.demo.demos.entity.User;
import org.example.thymeleaf.demo.demos.message.Result;
import org.example.thymeleaf.demo.demos.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * (User)表控制层
 *
 * @author makejava
 * @since 2024-09-24 09:35:50
 */
@RestController
@RequestMapping("/user")
public class UserController{

    @Resource
    private MapSearcher mapSearcher;

    @Resource
    private BeanSearcher beanSearcher;


    @GetMapping("/index")
    public Result<?> index(@RequestParam Map<String, Object> params) {
        // 这里咱们只写一行代码
        List<User> users = beanSearcher.searchList(User.class, params);
        return Result.success(users);
    }


}

